const { getLessors, searchLessors, frozenAccount, thawAccount } = require("../dao/lessorsDao");



//获取出租方信息
module.exports.getLessors = async function (lessors) {
    if (lessors.value) {
        //调用value有数据时的方法
        try {
            const data = await searchLessors(lessors)
            return data;
        } catch (error) {
            console.log(error, '报错');
        }
    } else {
        //显示所有的数据
        try {
            const data = await getLessors(lessors);
            return data;
        } catch (error) {
            console.log(error, '报错');
        }
    }
}

// 冻结账户
module.exports.frozenAccount = async function (frozen) {
    const data = await frozenAccount(frozen);
    return data
}

// 解冻账户
module.exports.thawAccount = async function (thaw) {
    const data = await thawAccount(thaw);
    return data
}